<template>
  <div class="tw-main">
    <div class="screen" >

      <el-row>
        <el-col :span="24">
          <el-row class="tw-grid">
            <el-col :lg="24" :span="24" class="tw-grid__left">
              <div style="display:flex; width:100%;">
                <div class="tw-new-title" style="text-align: right;width:300px;">
                  <div style="margin-top:32px;font-size:24px;color:#bad3ff">嘉兴市学校总数 </div>
                  <div style="margin-top:10px;font-size:32px;color:#bad3ff"><span class="digi">{{schoolSumNum}}</span><span style="font-size:24px">所</span></div>
                </div>
                <!-- <tw-echarts style="width:100%"
                  id="echarts_educationZoneSituation"
                  ref="echarts_educationZoneSituation"
                  :additionalOptions="additionalOptions['echarts_educationZoneSituation']"
                  height="184px"
                ></tw-echarts> -->
                <div ref="echarts_educationZoneSituation" style="width:100%;height:184px"></div>
                <div style="width:100px">&nbsp;</div>
              </div>
            </el-col>
          </el-row>
        </el-col>
        <el-col :span="16">
          <el-row class="tw-grid">
            <el-col :lg="12" :span="12" class="tw-grid__left" style="padding-right:0">
              <tw-card  :heightCard="'750px'">
                <!-- <div class="tw-new-title">
                  <p>嘉兴市学校总数 <span class="digi">{{schoolSumNum}}</span></p>
                </div>
                <tw-echarts
                  id="echarts_educationZoneSituation"
                  ref="echarts_educationZoneSituation"
                  :additionalOptions="additionalOptions['echarts_educationZoneSituation']"
                  height="46vh"
                ></tw-echarts> -->
                  <div class="tw-new-title" style="display:flex;justify-content: center;margin-top:30px">
                    <div>专任教师 <span class="digi">{{teachNumSum}}</span></div>
                    <div style="margin-left:30px">学生 <span class="digi">{{stuNumSum}}</span></div>
                  </div>
                  <tw-chart
                    :chartOption="baroption2.chartOption"
                    :dataset="baroption2.dataset"
                    :chartDataMaps="baroption2.chartDataMaps"
                    height='324px'
                  >
                  </tw-chart>

                  <div class="tw-new-title" style="margin-top:20px">
                    <p>生师比 <span class="digi">{{ssbZj}}</span></p>
                  </div>
                  <tw-echarts
                    id="echarts_indexTeacherStudentRatio"
                    ref="echarts_indexTeacherStudentRatio"
                    :additionalOptions="additionalOptions['echarts_indexTeacherStudentRatio']"
                    height="270px">
                  </tw-echarts>
              </tw-card>
            </el-col>
            <el-col :lg="12" :span="12" class="tw-grid__right" style="padding:0">
              <tw-card class="has-no-bg">
                <TwMap :clickDown="false" :mapWidth="'640px'" :mapHeight="'730px'"></TwMap>
              </tw-card>
            </el-col>
          </el-row>
        </el-col>
        <el-col :span="8" style="padding-right: 20px">
          <tw-card :heightCard="'750px'">
            <tw-echarts
              id="echarts_educationBasicSituation"
              ref="echarts_educationBasicSituation"
              :additionalOptions="additionalOptions['echarts_educationBasicSituation']"
              height="432px"
            ></tw-echarts>
            <tw-echarts
              id="echarts_indexSysTree"
              ref="echarts_indexSysTree"
              :additionalOptions="additionalOptions['echarts_indexSysTree']"
              height="302px"
            ></tw-echarts>
          </tw-card>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script scoped>
import echarts from 'echarts'
import TwCard from '@/components/TwCard.vue'
import TwEcharts from '@/components/TwEcharts.vue'
import TwBubble from '@/components/TwBubble.vue'
import TwTable from '@/components/TwTable.vue'
import TwItemInfo from '@/components/TwItemInfo.vue'
import TwOldChart from '@/components/TwOldChart.vue'
import cookieUtils from '@/config/cookieUtils'
import TwChart from '@/components/TwChart.vue'
import TwMap from '@/components/tw-map/TwMap.vue'

export default{
  props: [],
  components: {
    TwCard,
    TwEcharts,
    TwBubble,
    TwTable,
    TwItemInfo,
    TwOldChart,
    TwChart,
    cookieUtils,
    TwMap
  },
  data () {
    return {
      cityChild: [
        {
          'name': '市直属',
          'value': 20
        },
        {
          'name': '南湖区',
          'value': 20
        },
        {
          'name': '秀洲区',
          'value': 20
        },
        {
          'name': '经开区',
          'value': 20
        },
        {
          'name': '嘉善县',
          'value': 20
        },
        {
          'name': '平湖市',
          'value': 20
        },
        {
          'name': '海盐县',
          'value': 20
        },
        {
          'name': '海宁市',
          'value': 20
        },
        {
          'name': '桐乡市',
          'value': 20
        }
      ],
      stuNum: 0,
      stuNumSum: 0,
      teachNum: 0,
      // 专任教师的静态数据
      schoolSumNum: 0,
      baroption1: {},
      ssbZj: '0',
      teachNumSum: 0, // 老师总数
      pie: {
        chartOption: {
          tooltip: {
            trigger: 'item',
            formatter: '{a} <br/>{b}: {c} ({d}%)'
          },
          series: [
            {
              name: '',
              type: 'pie',
              roseType: 'area',
              avoidLabelOverlap: false,
              top: '5%',
              bottom: 0,
              left: 0,
              right: 0,
              label: {
                normal: {
                  show: true,
                  position: 'center',
                  textStyle: {
                    fontSize: 16
                  }
                },
                emphasis: {
                  show: true,
                  textStyle: {
                    fontSize: 16,
                    fontWeight: 'bold'
                  }
                }
              },
              labelLine: {
                normal: {
                  show: true
                }
              },
              data: []
            }
          ]
        },
        dataset: [],
        chartDataMaps: []
      },

      line: {
        chartOption: {
          tooltip: {
            trigger: 'axis',
            axisPointer: {
              type: 'cross',
              label: {
                backgroundColor: '#6a7985'
              }
            }
          },
          legend: {
            show: true,
            top: 0,
            textStyle: {
              fontSize: 16
            }
          },
          grid: {
            top: '25%',
            left: '3%',
            right: '4%',
            bottom: '5%',
            containLabel: true
          },
          xAxis: {
            type: 'category',
            boundaryGap: true,
            axisLabel: {
              fontSize: 16,
              interval: 0
            },
            data: []
          },
          yAxis: {
            type: 'value',
            axisLabel: {
              fontSize: 19
            }
          },
          series: []
        },
        chartDataMaps: [],
        dataset: []
      },
      baroption2: {},
      additionalOptions: {
        echarts_productionMap: {},
        echarts_educationBasicSituation: {},
        echarts_appAccessStatic: {},
        echarts_studentFlow: {},
        echarts_registerStudent: {},
        echarts_registerParent: {},
        echarts_registerTeacher: {},
        echarts_indexTeacher: {},
        echarts_educationZoneSituation: {},
        echarts_indexTeacherStudentRatio: {}
      },

      echarts_educationZoneSituation: null,
      staticOption: {
        tooltip: {
          trigger: 'item',
          formatter: function (params) {
            let res = ''
            if (!params.value) {
              return ''
            }
            res += params.seriesName + '<br />' + params.name + ': ' + Math.round(params.value) + '所' + '(' + params.percent + '%)'
            return res
          }
        },
        legend: {
          top: '15%',
          right: '0%',
          width: '200',
          data: ['学前', '小学', '初中', '普高', '中职', '特殊教育'],
          textStyle: {
            color: '#bad3ff',
            fontSize: 18
          },
          itemHeight: 6,
          itemWidth: 20
        },
        series: []
      }
    }
  },
  created () {
    // 接口使用次数
    this.interfacePlayInit()

    // 用户数量的动态数据
    this.userDataInt()

    // 师生比的动态数据
    this.teachStuNum()

    // echarts_indexTeacher 专任教师的动态数据
    // this.teachInitData()

    this.baroption2 = JSON.parse(JSON.stringify(this.line))
  },
  mounted () {
    let vm = this
    // 解决echarts tree图 自定义图片首次渲染时无法加载 轮询调echarts的resize 的方法 调用成功之后 清除定时器
    let treeSet = setInterval(() => {
      if (this.$refs['echarts_indexSysTree']) {
        this.$refs['echarts_indexSysTree'].resizeChart()
        clearInterval(treeSet)
      } else {
        this.$nextTick(() => {
          vm.interfacePlayInit()
        })
      }
    }, 1500)
    // 绑定echarts的resize方法
    window.onresize = () => {
      this.$refs['echarts_indexTeacherStudentRatio'].resizeChart()
      this.$refs['echarts_educationBasicSituation'].resizeChart()
      // this.$refs['echarts_indexTeacher'].resizeChart()
      // this.$refs['old_charts'].resizeChart()
      this.$refs['echarts_indexSysTree'].resizeChart()
    }

    // 学校数量
    this.schoolNum()
  },
  methods: {

    // 接口使用次数
    interfacePlayInit () {
      let vm = this
      this.$axios.get(`/tw-cloud-datatheme-server/themedata/app_sy_jksytj`).then(resp => {
        let {pageInfo, serverResult} = resp.data
        if (serverResult.resultCode === '200') {
          // this.$axios.get('/static/weishidataview/jsondata/echarts_indexSysTree.json', {
          //   baseURL: ''
          // }).then(response => {
          let dataObj = {
            'note': 'test',
            'leftTreeData': [
              {
                'name': '嘉兴市智慧教育公共服务平台',
                'label': {
                  'show': false
                },
                'children': vm.cityChild
              }
            ],
            'rightTreeData': [
              {
                'name': '嘉兴市智慧教育公共服务平台',
                'value': 100,
                'label': {
                  'fontSize': 18,
                  'align': 'center',
                  'color': '#d9e7ff',
                  'offset': [-60, 0],
                  'lineHeight': 24,
                  'rich': {
                    'a': {
                      'fontSize': 18
                    }
                  }
                },
                'children': [
                  {
                    'name': '户籍',
                    'value': 100,
                    'symbolSize': [100, 75],
                    'symbol': 'image:///static/weishidataview/images/hj.png',
                    'label': {
                      'show': false
                    },
                    'emphasis': {
                      'label': {
                        'show': false
                      }
                    },
                    'children': [
                      {
                        'name': '学期：109719次',
                        'value': 10
                      },
                      {
                        'name': '累计：111032次',
                        'value': 10
                      }
                    ]
                  },
                  {
                    'name': '社保',
                    'value': 100,
                    'symbolSize': [100, 75],
                    'symbol': 'image:///static/weishidataview/images/sb.png',
                    'label': {
                      'show': false
                    },
                    'emphasis': {
                      'label': {
                        'show': false
                      }
                    },
                    'children': [
                      {
                        'name': '学期：51401次',
                        'value': 10
                      },
                      {
                        'name': '累计：51583次',
                        'value': 10
                      }
                    ]
                  },
                  {
                    'name': '房产',
                    'value': 100,
                    'symbolSize': [100, 75],
                    'symbol': 'image:///static/weishidataview/images/fc.png',
                    'label': {
                      'show': false
                    },
                    'emphasis': {
                      'label': {
                        'show': false
                      }
                    },
                    'children': [
                      {
                        'name': '学期：121568次',
                        'value': 10
                      },
                      {
                        'name': '累计：122065次',
                        'value': 10
                      }
                    ]
                  }
                ]
              }
            ]
          }
          pageInfo.list.forEach(el => {
            if (el.jksylx.split(',')[0] === '户籍') {
              if (el.tjlx === '总计') {
                dataObj.rightTreeData[0].children[0].children[0].name = '总计:' + el.sysl + '次'
                dataObj.rightTreeData[0].children[0].children[0].value = el.sysl
              } else {
                dataObj.rightTreeData[0].children[0].children[1].name = '成功:' + el.sysl + '次'
                dataObj.rightTreeData[0].children[0].children[1].value = el.sysl
              }
            } else if (el.jksylx.split(',')[0] === '社保') {
              if (el.tjlx === '总计') {
                dataObj.rightTreeData[0].children[1].children[0].name = '总计:' + el.sysl + '次'
                dataObj.rightTreeData[0].children[1].children[0].value = el.sysl
              } else {
                dataObj.rightTreeData[0].children[1].children[1].name = '成功:' + el.sysl + '次'
                dataObj.rightTreeData[0].children[1].children[1].value = el.sysl
              }
            } else if (el.jksylx.split(',')[0] === '不动产') {
              if (el.tjlx === '总计') {
                dataObj.rightTreeData[0].children[2].children[0].name = '总计:' + el.sysl + '次'
                dataObj.rightTreeData[0].children[2].children[0].value = el.sysl
              } else {
                dataObj.rightTreeData[0].children[2].children[1].name = '成功:' + el.sysl + '次'
                dataObj.rightTreeData[0].children[2].children[1].value = el.sysl
              }
            }
          })
          this.additionalOptions.echarts_indexSysTree = dataObj
          // }, response => {
          // })
        }
      })
    },
    // 数组对象排序
    sortData (a, b) {
      return b.yhsl - a.yhsl
    },

    // 用户数量的动态数据
    userDataInt () {
      let vm = this
      vm.$axios.get(`/tw-cloud-datatheme-server/themedata/app_sy_xtyhsltj`).then((resp) => {
        let {pageInfo, serverResult} = resp.data
        if (serverResult.resultCode === '200') {
          let links = []
          let sources = []
          let yhSum = 0
          let authList = []
          let teachApList = []
          let stuApList = []
          let parApList = []
          let apList = []
          pageInfo.list.forEach(item => {
            if (item.ssxt === '用户中心') {
              links.push({
                source: '用户中心',
                target: item.yhlx,
                value: item.yhsl
              })
              yhSum += item.yhsl
              sources[0] = {
                name: '用户中心',
                value: 0
              }
              sources.push({
                name: item.yhlx,
                value: item.yhsl
              })
            } else {
              authList.push(item)
            }
          })
          sources[0].value = yhSum
          authList = authList.sort(this.sortData) // 根据用户使用量进行排序
          authList.forEach((el, index) => {
            apList.push({
              name: el.ssxt,
              value: 0
            })
            if (el.yhlx === '教师') {
              teachApList.push(el)
            } else if (el.yhlx === '学生') {
              stuApList.push(el)
            } else {
              parApList.push(el)
            }
          })
          teachApList.forEach((el, index) => {
            links.push({
              source: '教师',
              target: el.ssxt,
              value: el.yhsl
            })
          })
          stuApList.forEach((el, index) => {
            links.push({
              source: '学生',
              target: el.ssxt,
              value: el.yhsl
            })
          })
          parApList.forEach((el, index) => {
            links.push({
              source: '家长',
              target: el.ssxt,
              value: el.yhsl
            })
          })
          apList = this.$getArrListByname(apList)
          pageInfo.list.forEach(item => {
            apList.forEach(el => {
              if (el.name === item.ssxt) {
                el.value += item.yhsl
              }
            })
          })
          sources = sources.concat(apList)

          let dataObj = {
            links: links,
            note: '桑基图',
            sources: sources
          }
          this.additionalOptions.echarts_educationBasicSituation = dataObj
          this.$refs['echarts_educationBasicSituation'].resizeChart()
        }
      }).catch(() => {
        // console.log(err)
      })
    },

    // 学校的动态数据
    schoolNum () {
      let vm = this
      let dataList = []
      vm.cityChild.forEach(item => {
        dataList.push({
          data: [0.001, 0.001, 0.001, 0.001, 0.001, 0.001],
          name: item.name,
          releavName: item.name
        })
      })
      let schoolNameList = ['学前', '小学', '初中', '中职', '普高', '特殊教育']

      let quary = { 'conditions': [], 'fields': [] }
      let tjnf = 2019
      let timeSectionValue = [{ 'fieldName': 'tjnf', 'fieldValues': [tjnf], 'operator': 'IN', 'prepender': 'AND' }]
      quary.conditions = timeSectionValue

      vm.$axios.post(`/tw-cloud-datatheme-server/themedata/app_sy_qyxxsltj`, quary).then((resp) => {
        let data = {}
        let {pageInfo, serverResult} = resp.data
        if (serverResult.resultCode === '200') {
          pageInfo.list.forEach(el => {
            this.schoolSumNum += el.xxsl
            dataList.forEach(item => {
              if (item.releavName === el.djsmz || (el.djsmz.indexOf('嘉兴市') > -1 && item.releavName === '市直属') || (el.djsmz.indexOf('经济开发区') > -1 && item.releavName === '经开区')) {
                if (el.jyjb === schoolNameList[0]) {
                  item.data[0] += el.xxsl
                } else if (el.jyjb === schoolNameList[1]) {
                  item.data[1] += el.xxsl
                } else if (el.jyjb === schoolNameList[2]) {
                  item.data[2] += el.xxsl
                } else if (el.jyjb === schoolNameList[3]) {
                  item.data[3] += el.xxsl
                } else if (el.jyjb === schoolNameList[4]) {
                  item.data[4] += el.xxsl
                } else if (el.jyjb === '特殊') {
                  item.data[5] += el.xxsl
                }
              }
            })
          })
        }
        data = {
          data: dataList,
          name: schoolNameList,
          note: '教育分区统计'
        }
        // this.additionalOptions.echarts_educationZoneSituation = data
        vm.$nextTick(() => {
          vm.setStaticOption(data)
        })
      }).catch(() => {
        let data = {
          data: dataList,
          name: schoolNameList,
          note: '教育分区统计'
        }
        vm.setStaticOption(data)
      })
    },

    setStaticOption (data) {
      let vm = this
      if (!vm.echarts_educationZoneSituation) {
        if (vm.$refs.echarts_educationZoneSituation) {
          vm.echarts_educationZoneSituation = echarts.init(vm.$refs.echarts_educationZoneSituation)
        } else {
          return
        }
      } else {
        vm.echarts_educationZoneSituation.clear()
      }

      let colors = ['#ffea7f', '#00e2fe', '#1890ff', '#6439d2', '#fa6bb3', '#ffb686', '#7574ee']

      let circleCenter = [
        ['5%', '35%'], ['15%', '35%'], ['25%', '35%'], ['35%', '35%'],
        ['45%', '35%'], ['55%', '35%'], ['65%', '35%'], ['75%', '35%'], ['85%', '35%']
      ]

      let circleRadius = [
        ['42%', '50%'], ['42%', '50%'], ['42%', '50%'], ['42%', '50%'],
        ['42%', '50%'], ['42%', '50%'], ['42%', '50%'], ['42%', '50%'], ['42%', '50%']
      ]

      data.data.forEach((d1, d2) => {
        vm.staticOption.series.push({
          name: d1.name,
          type: 'pie',
          startAngle: -90,
          radius: circleRadius[d2],
          center: circleCenter[d2],
          legendHoverLink: false,
          avoidLabelOverlap: false,
          hoverAnimation: false,
          label: {
            show: false
          },
          labelLine: {
            show: false,
            length: 30,
            length2: 0
          },
          data: []
        })
        let total = 0
        vm.staticOption.series[d2].data.push({
          value: 0,
          itemStyle: {
            opacity: 0
          },
          label: {
            show: true,
            position: 'outside',
            padding: [0, 0, 0, -35],
            textStyle: {
              fontSize: '20',
              color: '#bad3ff'
            },
            formatter: () => {
              return d1.name
            }
          }
        })
        d1.data.forEach((p1, p2) => {
          vm.staticOption.series[d2].data.push({
            name: data.name[p2],
            value: p1,
            itemStyle: {
              color: colors[p2]
            }
          })
          total += p1
        })
        vm.staticOption.series[d2].data.push({
          value: 0,
          itemStyle: {
            opacity: 0
          },
          label: {
            show: true,
            position: 'center',
            textStyle: {
              fontSize: '30',
              fontFamily: 'customer',
              color: '#fff'
            },
            formatter: (params) => {
              return Math.round(total)
            }
          }
        })
      })

      vm.echarts_educationZoneSituation.setOption(vm.staticOption)

      vm.echarts_educationZoneSituation.off('legendselectchanged')
      vm.echarts_educationZoneSituation.on('legendselectchanged', function (params) {
        let selected = params.selected

        let status = false
        let keys = []
        for (let key in selected) {
          if (selected[key]) {
            status = selected[key]
            keys.push(key)
          }
        }

        let values = []
        let schoolSumNum = 0
        data.data.forEach(item => {
          let a = 0
          if (keys.length === 0) {
            a += item.data[0]
          }
          if (keys.includes(data.name[0])) {
            a += item.data[0]
          }
          if (keys.includes(data.name[1])) {
            a += item.data[1]
          }
          if (keys.includes(data.name[2])) {
            a += item.data[2]
          }
          if (keys.includes(data.name[3])) {
            a += item.data[3]
          }
          if (keys.includes(data.name[4])) {
            a += item.data[4]
          }
          if (keys.includes(data.name[5])) {
            a += item.data[5]
          }
          schoolSumNum += a
          values.push(a)
        })

        let series = vm.staticOption.series
        vm.staticOption.series.forEach((itm, idx) => {
          itm.data.pop()
          itm.data.push({
            value: 0,
            itemStyle: {
              opacity: 0
            },
            label: {
              show: true,
              position: 'center',
              textStyle: {
                fontSize: '30',
                fontFamily: 'customer',
                color: '#fff'
              },
              formatter: (params) => {
                return Math.round(values[idx])
              }
            }
          })
        })

        if (!status) {
          selected['学前'] = true
          vm.echarts_educationZoneSituation.setOption({ legend: { selected }, series: series })
        } else {
          vm.echarts_educationZoneSituation.setOption({ series: series })
        }
        vm.schoolSumNum = Math.round(schoolSumNum)
      })
    },

    // 师生比的动态数据
    teachStuNum () {
      let vm = this
      this.stuNumSum = 0
      this.teachNumSum = 0
      let dataset = []
      vm.$axios.get(`/tw-cloud-datatheme-server/themedata/app_sy_ssbtj?tjnf=2019`).then((resp) => {
        let {pageInfo, serverResult} = resp.data
        let jssl = 0
        let xssl = 0
        if (serverResult.resultCode === '200') {
          let ssbObj = {
            note: 'test',
            seriesData: []
          }
          let ssbseriesData = []
          pageInfo.list.forEach(item => {
            if (item.jyjb === '总计') {
              this.ssbZj = item.xsbl + ' : 1'
            } else {
              jssl += item.jssl ? item.jssl : 0
              xssl += item.xssl ? item.xssl : 0
              let name = item.jyjb
              if (item.jyjb === '高中') {
                name = '普高'
              } else if (item.jyjb === '幼儿园') {
                name = '学前'
              } else if (item.jyjb === '特殊') {
                name = '特殊教育'
              }

              ssbseriesData.push({
                name: name,
                ratio: ' ' + item.xsbl + ' : 1',
                value: item.xsbl.toFixed(3) - 0
              })

              dataset.push({
                name: name,
                value: item.jssl === 0 ? 1 : item.jssl,
                value1: item.xssl === 0 ? 1 : item.xssl
              })
            }
          })

          let a = ['学前', '小学', '初中', '普高', '中职', '特殊教育']
          a.forEach((itm) => {
            let b = ssbseriesData.filter(it => it.name === itm)
            if (b.length > 0) {
              ssbObj.seriesData.push(b[0])
            } else {
              ssbObj.seriesData.push({
                name: itm,
                value: 0,
                value1: 0
              })
            }
          })
          this.additionalOptions.echarts_indexTeacherStudentRatio = ssbObj
        }

        this.stuNumSum = this.$reformNumber(xssl)
        this.teachNumSum = this.$reformNumber(jssl)
        this.setBarOption2(dataset)
      }).catch((err) => {
        console.log(err)
      })
    },
    setBarOption2 (data) {
      let toolTip = this.baroption2.chartOption.tooltip
      let grid = this.baroption2.chartOption.grid
      let legend = this.baroption2.chartOption.legend
      let yAxis = this.baroption2.chartOption.yAxis
      yAxis.type = 'log'
      legend.show = false
      grid.top = '10%'
      toolTip.formatter = function (datas) {
        var res = datas[0].name + '<br/>'
        for (var i = 0, length = datas.length; i < length; i++) {
          res += datas[i].seriesName + '：' +
            datas[i].data.value + '人' + '<br/>'
        }
        return res
      }
      let dataset = []
      let chartDataMaps = [
        {
          'name': '专任教师',
          'dataKey': 'value'
        },
        {
          'name': '学生',
          'dataKey': 'value1'
        }]

      // dataset = this.$getArrListByname(data)
      let a = ['学前', '小学', '初中', '普高', '中职', '特殊教育']
      a.forEach((itm) => {
        let b = data.filter(it => it.name === itm)
        if (b.length > 0) {
          dataset.push(b[0])
        } else {
          dataset.push({
            name: itm,
            value: 0,
            value1: 0
          })
        }
      })
      this.baroption2.dataset = dataset
      this.baroption2.chartDataMaps = chartDataMaps.map((item, index) => {
        return {
          ...item,
          type: 'bar',
          barMaxWidth: 18
        }
      })
    }
  },

  beforeDestroy () {
    if (this.echarts_educationZoneSituation) {
      this.echarts_educationZoneSituation.dispose()
      this.echarts_educationZoneSituation = null
    }
  }
}
</script>

<style scoped></style>
